package com.rew.canteenbox.models;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import com.rew.canteenbox.bases.ActivityController;

/**
 *  结束对话框.
 *
 * Created by HuiWen Ren on 2016/10/19.
 */
public class ExitDialog {
    public static Dialog exitDialog(Context context) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle("退出确认");
        builder.setMessage("确定要退出吗?");
        builder.setPositiveButton("确定",
                (dialog, whichButton) -> ActivityController.finishAll());
        builder.setNegativeButton("取消",
                (dialog, whichButton) -> {
                });
        return builder.create();
    }
}
